<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:f="http://java.sun.com/jsf/core"
	  xmlns:ui="http://java.sun.com/jsf/facelets">
	<h:head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<title>Fan Page</title>
		<meta name="title" content="" />
		<meta name="keywords" content="" />
		<meta name="description" content="" />
	</h:head>
	<h:body>
		<p>Найдено: <h:outputText value="#{page_search.getCount()}" /></p>
		<p>Страниц: <h:outputText value="#{page_search.getCountPages()}" /></p>
		<table border="1">
			<ui:repeat value="#{page_search.results}" var="result">
				<tr><td>
					<h:outputText value="#{result.getCatalogTitle()}" />
				</td></tr>
				<tr><td>
					<h:form>
						<h:commandButton value="#{result.getTitle()}" action="#{page_search.openPage(result.getCatalogTitle(), result.getId())}" />
					</h:form>
				</td></tr>
			</ui:repeat>
		</table>
		<h:form>
			<h:commandButton value="в начало" action="#{page_search.setPage(1)}" />
			<h:commandButton rendered="#{page_search.getIsPageExists(-1)}" value="#{page_search.getPageNumber(-1)}" action="#{page_search.setDiffPage(-1)}" />
			<h:commandButton rendered="#{page_search.getIsPageExists(0)}" value="#{page_search.getPageNumber(0)}" action="#{page_search.setDiffPage(0)}" />
			<h:commandButton rendered="#{page_search.getIsPageExists(1)}" value="#{page_search.getPageNumber(1)}" action="#{page_search.setDiffPage(1)}" />
			<h:commandButton value="в конец" action="#{page_search.setPageCount()}" />
		</h:form>
	</h:body>
</html>